feat(dictation): recover Esc-cancelled recordings - #989
Draft
MarkShawn2020 wants to merge 3 commits into
Draft
Conversation
Collaborator
|
按了就是按了 没按就是没按 没必要做这些东西 |
Collaborator
|
更何况还是默认的 会烦人 |
Collaborator
|
鉴于是冷门路径 我再考虑一下 |
Contributor
Author
可以作为一个开关吧 |
Collaborator
|
可以 那你加开关 |
H-Chris233
marked this pull request as draft
August 26, 2026 07:51
Contributor
Author
|
已按讨论完成优化:
关于「仅在前台应用没有消费 Esc 时才由 OpenLess 处理」:当前 CGEventTap 回调发生在目标应用分发按键之前,只能当场决定吞掉或放行;浏览器/AppKit 处理后不会向全局事件 tap 回传 本次已合并最新 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
betaand preserve its Windows selection-voice session guardEsc routing decision
OpenLess currently observes Esc through a global OS-level event tap before the foreground application handles the key. At that point it can either suppress the event or pass it on, but macOS does not send a later acknowledgement indicating whether a browser/AppKit responder consumed it. Browser bubbling and
preventDefault()are internal to the browser process and cannot propagate back to the event tap.Apple documents the same boundary for event monitors: a global monitor cannot modify/prevent delivery, while a local monitor only controls events dispatched inside its own app. Therefore “let the foreground app consume Esc first, then cancel OpenLess only if it remained unconsumed” is not reliable for a cross-application voice input tool.
The opt-in setting is retained as the deterministic behavior: users who want recoverable Esc cancellation can enable it; everyone else keeps direct cancellation without a recovery capsule.
Behavior
Verification
git diff --checkpassed